package objects;

import java.awt.Graphics2D;
import java.awt.geom.Line2D;

import player.Player;

public class Connection{

	private Line2D path;
	MapObject partner1, partner2;
	Player owner;
	//Connection-Typ
	public String type="none";
	
	public Connection(MapObject mo1, MapObject mo2, Player player) {
		path=new Line2D.Double(mo1.center,mo2.center);
		partner1=mo1;
		partner2=mo2;
		type=setType();
	}
	
	public void drawPath(Graphics2D g){
		g.draw(path);
		//g.drawString(type, (int)partner1.center.getX(),(int)partner1.center.getY());
	}
	
	
	//Connection charakterisieren
	//Verwendung noch unklar
	public String setType() {
		//???
		//Class<?> class1=partner1.getClass();
		//Class<?> class2=partner2.getClass();
		
		String type="none";
		if( partner1 instanceof ResourceNode || partner2 instanceof ResourceNode ) {
			if(partner1 instanceof Node || partner2 instanceof Node) {
				type="res";
			}
		}
		return type;
	}
	
}